HandleSelection
NEW WITH CONTEXTUAL MENUS
Executes the contextual menu item chosen by the user. If you write a contextual menu plug-in, it must contain aHandleSelection
method with the following form:
OSStatus HandleSelection(AEDesc* inContextDescriptor, SInt32 inCommandID);
inContextDescriptor
- The context chosen by the user. This data is the same as that passed in the
inContextDescriptor
parameter for theExamineContext
method. The Menu Manager passes this in the form of a pointer to an Apple Event descriptor. See Inside Macintosh: Interapplication Communication for information about the form of this descriptor.inCommandID
- A long integer assigned to the chosen menu item via the
keyContextualMenuCommandID
descriptor, passed in by the Menu Manager.- method result
- A result code. See "Result Codes" for a list of possible values. If this value is not
noErr
then the Menu Manager does not use the plug-in in this case. However, it will callHandleSelection
again the next time an action is selected.DISCUSSION
If one of the plug-in's menu items is chosen, the Menu Manager calls the plug-in'sHandleSelection
method to execute the action. The plug-in should then perform the appropriate action.